﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SelfAnimDestroy : MonoBehaviour {

    private Animator animator;

    void Awake()
    {
        animator = GetComponent<Animator>();
    }

	void Update () {
        //获取动画层 0 指Base Layer.
        AnimatorStateInfo stateinfo = animator.GetCurrentAnimatorStateInfo(0);
        if (stateinfo.normalizedTime>=1)
        {
            Destroy(gameObject);
        }
    }
}
